package com.qyt.springboot_jpa75.dao;

import com.qyt.springboot_jpa75.pojo.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.Repository;

import java.util.List;

public interface  userDao extends CrudRepository<User, Long>, JpaRepository<User,Long>, PagingAndSortingRepository<User,Long>, Repository<User,Long> {
//    自定义模糊查询语句 也可以自定义修改语句
@Query(value="from User where userName like concat('%',?1,'%') ")
    List<User>getLikeUserName(String userName);

}
